<template>
    <div class="app-container">
        <div class="logdetailheader">
            <div class="title1">
                执行日志 Console
            </div>
            <div class="title2">
                <a href="javascript:location.reload()" class="title3">点击刷新</a>
                <!-- <el-button type="text" @click="Refresh"  icon="el-icon-refresh-right" class="title3">刷新</el-button> -->
            </div>
    </div> 
    <div class="logdetailbody">   
        <span v-html="`${logdata.logContent}`.replace(/\n/g,'<br/>')"></span>
        <br>
        <span style="color: green;">[Load Log Finish]</span>
    </div>
    </div>
</template>
<script>
import { getlogdetail } from "@/api/xxl-job/logdetail";
export default{
    name:"LogDetail",
    data(){
        return{
            query:{
                logId:null,
                fromLineNum:1,
            },
            logdata:{},
        }
    },
    created(){
        let id = this.$route.params.id;
        this.query.logId = id*1;
        this.getlog()
    },
    methods: {
        getlog(){
            getlogdetail(this.query).then(response=>{
                this.logdata=response.data
            })
        },
        // Refresh(){
        //     location.reload();
        // }
    },
}
</script>
<style>
.logdetailheader{
    display: flex;
    background-color: rgb(60,141,188);
    line-height: 80px;
    color: white;
    position: relative;
}
.logdetailheader>.title1{
    text-align: center;
    width: 100%;
    height: 80px;
    font-size: 20px;
}
.logdetailheader>.title2{
    text-align: center;
    width: 100%;
    height: 80px;
}
.title3{
    color: white;
    font-size: 20px;
}
.title3:hover{
    color: white;
}
.logdetailbody{
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background-color:rgb(245,245,245);
    border: 1px solid rgb(124, 127, 124);
}
</style>